Command Line Support
The Execute Process node can be added to the master flow to enable you to call and execute external code and applications. You can use this node to run any cmd commands that exists on the Pyramid server.
This can be used for all manner of tasks, including renaming or moving files, pinging the server, and more.
Execute Process Node
To execute commands, add the Execute Process node to the master flow (blue arrow below), and configure its properties (green highlight below).
You'll enter the command in the node's script window (as in the image below), beneath which you can opt to load the results of the script into a given variable. Via this process, you can attach other master flow nodes to the Execute Process node. For instance, you could attach a conditional node and determine that if the command runs successfully, the current data model should be processed, but it fails, a Pyramid Event should be triggered to process a different model.
Execute Process Properties
General
Under the general properties, name the node and add a description.
Execute process
Add your command in the script window. You can write or paste a script directly, or open the PQL editor to build a script.
Under the script window are 4 options:
Expression: enable to create a PQL expression. When enabled, a PQL icon will appear in the script window; click the icon to open the PQL editor.
Load result into variable: load the script results into the selected variable.
Load error into variable: if the script returns an error, load the error into the selected variable.
Load status code into variable: if the script returns a status code, load it into the selected variable
Test the Command
You can test the node by right clicking on it and selecting Execute from the context menu:
The progress panel will display the progress of the execution, and the Variables can be opened to see the command results:
This example uses the Execute Process node to execute a ping command to ping the server. The results of the command are then loaded into a variable. A conditional node is added, with an expression stating that the results in the variable must contain the string "lost = 0". If this resolves to true, the data model will be processed. If it resolves to false, an email will be triggered instead.
Step 1
Add the Execute Process node and enter the command in its script window. In this example, a simple script is entered to ping the server:
Step 2
Determine what to load into the variable; in this example, the results will be loaded into a string variable:
Step 3
Add the Conditional not to the Execute Process node:
Step 4
Configure a PQL expression for the Conditional node; in this example the expression is based in the Contains function:
Contains(@Variable, "lost = 0"
Step 5
For the True condition, add a Data Flow node; if the results loaded into the variable by the ping command show "lost = 0", the data flow will be processed.
For the False condition, add an Email node; if the conditional statement resolves to false, an email will be triggered. In the email's content (green highlight below) enable 'Expression' and add the PQL expression @Variable to feed to results of the command from the variable into the email.